﻿namespace GmailReader.Tests
{
    using System.IO;
    using System.Reflection;

    public class FeedDownloaderMock : IFeedDownloader
    {
        internal FeedHelper.EnumFeed Feed { get; set; }

        public string Download()
        {
            return FeedHelper.Load(Feed);
        }
    }

    internal abstract class FeedHelper
    {
        internal enum EnumFeed
        {
            Empty,
            One,
            Five
        }

        internal static string Load(EnumFeed feed)
        {
            string name = "GmailReader.Tests.Feeds." + feed.ToString() + ".xml";
            using (StreamReader reader = new StreamReader(Assembly.GetExecutingAssembly().GetManifestResourceStream(name)))
            {
                return reader.ReadToEnd();
            }
        }
    }
}
